<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr=[1,2,5,6,42,2];
        Array.prototype.myMap=function(handler){
            var arr1=[];
            for (i=0;i<this.length;i++){
                var item=this[i];
                var result=handler(item);
                arr1.push(result)
            }
            return arr1
        }
        var result=arr.myMap(function(item){
            return item*2
        })
        console.log(result)
    </script>
</head>
<body>
    
</body>
</html>